package com.qf.mvc2202.controller;

import com.qf.mvc2202.entity.User;
import com.qf.mvc2202.exhandler.UserException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/jack")
public class JacksonController {
    @Autowired
    private User user;

    @RequestMapping("/dateformate")
    public User getUser(){

        if (true) {
//            throw new UserException(1001,"插入用户失败");
            int a = 1/0;
        }
        user.setHobby(null);
        return user;
    }

}
